package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.MySecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@MySecurity({"Rose"})
@LagouController
@LagouRequestMapping("/demo")
public class DemoController {

   @MySecurity({ "Tom" })
   @LagouRequestMapping("/getUserName")
    public String getUserName(HttpServletRequest request, HttpServletResponse response,String username) {
        String msg= "Hello  "+username+",this is interface getUserName.";
        System.out.println(msg);
        return "index";
    }

    @MySecurity({ "Ann" })
    @LagouRequestMapping("/findUserByName")
    public String findUserByName(HttpServletRequest request, HttpServletResponse response,String username) {
        String msg="Hello  "+username+",this is interface findUserByName.";
        System.out.println(msg);
        return "index";
    }
}
